package org.person.gift.doc;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.math.BigDecimal;
import java.util.Date;
@Document(indexName = "gift_gift",type = "gift")
public class GiftSpuDoc {
    @Id
    private Long id; //spuid
    @Field(type = FieldType.Keyword)
    private String cover;
    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart" )
    private String goodsName;
    @Field(type = FieldType.Long)
    private Long tenantId;
    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart")
    private String tenantName;
    @Field(type = FieldType.Long)
    private Long categoryId;
    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart")
    private String categoryName;
    @Field(type = FieldType.Long)
    private Long brandId;
    @MultiField(mainField = @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart"),
    otherFields = @InnerField(suffix = "keyword",type = FieldType.Keyword))
    private String branName;
    @Field(type = FieldType.Integer)
    private Integer commentCount;
    @Field(type = FieldType.Integer)
    private Integer saleCount;
    @Field(type = FieldType.Double)
    private BigDecimal highPrice;
    @Field(type = FieldType.Double)
    private BigDecimal lowPrice;
    @Field(type = FieldType.Keyword)
    private String specProperties;
    @Field(type = FieldType.Keyword)
    private String skuProperties;

    @Field(type = FieldType.Date)
    private Date onsaleTime = new Date();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Long getBrandId() {
        return brandId;
    }

    public void setBrandId(Long brandId) {
        this.brandId = brandId;
    }

    public String getBranName() {
        return branName;
    }

    public void setBranName(String branName) {
        this.branName = branName;
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Integer getSaleCount() {
        return saleCount;
    }

    public void setSaleCount(Integer saleCount) {
        this.saleCount = saleCount;
    }

    public BigDecimal getHighPrice() {
        return highPrice;
    }

    public void setHighPrice(BigDecimal highPrice) {
        this.highPrice = highPrice;
    }

    public BigDecimal getLowPrice() {
        return lowPrice;
    }

    public void setLowPrice(BigDecimal lowPrice) {
        this.lowPrice = lowPrice;
    }

    public String getSpecProperties() {
        return specProperties;
    }

    public void setSpecProperties(String specProperties) {
        this.specProperties = specProperties;
    }

    public String getSkuProperties() {
        return skuProperties;
    }

    public void setSkuProperties(String skuProperties) {
        this.skuProperties = skuProperties;
    }

    public Date getOnsaleTime() {
        return onsaleTime;
    }

    public void setOnsaleTime(Date onsaleTime) {
        this.onsaleTime = onsaleTime;
    }

    @Override
    public String toString() {
        return "GiftSpuDoc{" +
                "id=" + id +
                ", cover='" + cover + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", tenantId=" + tenantId +
                ", tenantName='" + tenantName + '\'' +
                ", categoryId=" + categoryId +
                ", categoryName='" + categoryName + '\'' +
                ", brandId=" + brandId +
                ", branName='" + branName + '\'' +
                ", commentCount=" + commentCount +
                ", saleCount=" + saleCount +
                ", highPrice=" + highPrice +
                ", lowPrice=" + lowPrice +
                ", specProperties='" + specProperties + '\'' +
                ", skuProperties='" + skuProperties + '\'' +
                ", onsaleTime=" + onsaleTime +
                '}';
    }
}
